import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:paly_android/api/api.dart';
import 'package:paly_android/bean/project_tree_entity.dart';
import 'package:paly_android/net/dio_client.dart';

class ProjectBloc extends Cubit<List<ProjectTreeEntity>> {
  ProjectBloc() : super(List.empty(growable: true));

  void getProjectTree() {
    DioClient.instance.get(Api.PROJECT_TREE,
        onSuccess: (List<ProjectTreeEntity> data) {
      emit(data);
    });
  }
}
